package com.elder.business.mapper;

import java.util.List;
import com.elder.business.domain.ElderlyApartmentBeds;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;

/**
 * 床位信息Mapper接口
 * 
 * @author elder
 * @date 2023-11-26
 */
public interface ElderlyApartmentBedsMapper 
{
    /**
     * 查询床位信息
     * 
     * @param id 床位信息主键
     * @return 床位信息
     */
    public ElderlyApartmentBeds selectElderlyApartmentBedsById(Long id);

    /**
     * 查询床位信息列表
     * 
     * @param elderlyApartmentBeds 床位信息
     * @return 床位信息集合
     */
    public List<ElderlyApartmentBeds> selectElderlyApartmentBedsList(ElderlyApartmentBeds elderlyApartmentBeds);

    /**
     * 新增床位信息
     * 
     * @param elderlyApartmentBeds 床位信息
     * @return 结果
     */
    public int insertElderlyApartmentBeds(ElderlyApartmentBeds elderlyApartmentBeds);

    /**
     * 修改床位信息
     * 
     * @param elderlyApartmentBeds 床位信息
     * @return 结果
     */
    public int updateElderlyApartmentBeds(ElderlyApartmentBeds elderlyApartmentBeds);

    /**
     * 删除床位信息
     * 
     * @param id 床位信息主键
     * @return 结果
     */
    public int deleteElderlyApartmentBedsById(Long id);

    /**
     * 批量删除床位信息
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteElderlyApartmentBedsByIds(Long[] ids);

    List<ElderlyApartmentBeds> getElderRoomBedInfo(@Param("roomIds") List<Long> roomIds);

    Integer updateElderlyApartmentBedInfo(@Param("roomId") Long roomId,@Param("bedId") Long bedId,@Param("elderId") Long elderId);

    Integer updateElderRoomBedInfo(@Param("elderId") Long elderId);

    ElderlyApartmentBeds getElderRoomBedInfoByElderId(Long elderId);

    public Integer updateBedLiveStatus(@Param("elderId") Long elderId,@Param("bedStatus") Integer bedStatus);

    List<ElderlyApartmentBeds> getElderRoomBedInfoList(@Param("elderIds") List<Long> elderIds,@Param("bedStatus") Integer bedStatus,@Param("roomIds") List<Long> roomIds);

    //根据房间id获取房间空闲的床位信息
    List<ElderlyApartmentBeds> getElderRoomBedInfoByRoomId(@Param("roomId") Long roomId);

    Integer updatedelElderRoomBedInfo(Long elderId);

    List<ElderlyApartmentBeds> getAllRoomBeds();

    Integer setElderRoomBedInfo(@Param("bedState") Integer bedState,@Param("elderId") Long elderId,@Param("bedId") Long bedId);

    List<ElderlyApartmentBeds> getBedsByBedIds(@Param("bedIds")  List<Long> bedIds);
}
